#!/usr/bin/node

const argv = process.argv,
      log  = console.log;

//1.argv number equal 3, 判断命令行参数
//code is number
//code range > 0
//数据是否合法： 校验：1.空值 2.数据类型 3.取值范围
//validate argv

if(argv.length !== 3){
  log('cmd exit-code');
  process.exit(1);
}
if(isNaN(Number(argv[2]))){
  log('argv must be number');
  process.exit(2);
}
if(Number(argv[2])<0){
  log('argv must > 0');
  process.exit(3);
}
process.exit(argv[2]);
